package mRegex;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
* @author jie
* @version 创建时间：2018年11月29日 下午2:46:39
* 类说明
*/
public class D1 {
	public static void main(String[] args) {
//		System.out.println(isTextMatch("_"));
//		System.out.println(isTextMatch("ab汉字"));
		System.out.println(isNumWordMatch("ab"));
		System.out.println(isNumWordMatch("cc_"));
		System.out.println(isNumWordMatch("cc@"));
		System.out.println(isNumWordMatch("@"));
		
		
	}
	
	 public static boolean isTextMatch(String regexString) {
//       final String regex = "[——'’%=\\\\<>_;#:||\\[\\]&/|-]";
       final String regex = "['%|_;&/#:\\\\]";
       Pattern p = Pattern.compile(regex);
       Matcher matcher = p.matcher(regexString);
       boolean isMatch = matcher.find();
       return isMatch;
   }
	 public static boolean isNumWordMatch(String regexString) {
//       final String regex = "[——'’%=\\\\<>_;#:||\\[\\]&/|-]";
		 final String regex = "[A-Za-z\u4e00-\u9fa5]";
		 Pattern p = Pattern.compile(regex);
		 Matcher matcher = p.matcher(regexString);
		 boolean isMatch = matcher.find();
		 return isMatch;
	 }
}
